package com.ruoyi.web.controller.access;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.service.SysPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;

/**
 * Author: Stefbing
 * Created: 2023-07-04 14:45
 * Description: 易制毒入网校验
 */
@RestController
@RequestMapping("/access")
public class YzdAccessController extends BaseController {

    @Autowired
    private SysPermissionService permissionService;
    /**
     * 校验当前用户
     */
    @GetMapping
    public AjaxResult getInfo()
    {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        // 入网进度
        int progress = permissionService.getUnitPermission(user);
        // 权限集合
        AjaxResult ajax = AjaxResult.success();
        ajax.put("user", user);
        ajax.put("roles", roles);
        ajax.put("permissions", permissions);
        return ajax;
    }

}
